//
//  GuideSwipeView.m
//  PhoneSpecs
//
//  Created by Le Anh Tai on 12/7/14.
//  Copyright (c) 2014 Le Anh Tai. All rights reserved.
//

#import "GuideSwipeView.h"

@implementation GuideSwipeView

- (instancetype)init
{
    if (self = [super init])
    {
        _alphaView = [[UIView alloc] init];
        _alphaView.backgroundColor = [UIColor blackColor];
        _alphaView.alpha = 0.6;
        [self addSubview:_alphaView];
        
        UIImage *image = [UIImage imageNamed:@"swipeRightClose.png"];
        _handView = [[UIImageView alloc] initWithImage:image];
        _handView.size = image.size;
        [self addSubview:_handView];
        
        _guideLabel = [[UILabel alloc] init];
        _guideLabel.textColor = [UIColor whiteColor];
        _guideLabel.text = @"Vuốt qua phải để đóng";
        
        if (IS_IPHONE)
        {
            _guideLabel.font = FONT(24);
        }
        else
        {
            _guideLabel.font = FONT(40);
        }
        
        [_handView addSubview:_guideLabel];        
    }
    
    return self;
}

- (void)setFrame:(CGRect)frame
{
    [super setFrame:frame];
    
    _alphaView.frame = self.bounds;
    _handView.center = POINT(self.width/2, self.height/2 + 50);
    [_guideLabel sizeToFit];
    _guideLabel.center = POINT(_handView.width/2, -_guideLabel.height + 30);
}

@end
